import {createChunk} from './createChunk.js';
onmessage = async function(e){
	// console.log(e.data,'222')
	const{
		file,
		_SIZE,
		start,
		end,
	} = e.data;
	const result = []
	for (let i = start; i < end ;i++) {
		const prom =  createChunk(file,i,_SIZE)
		result.push(prom)
	}
	const chunks = await Promise.all(result)
	postMessage(chunks)
}
